package com.numberone.system.service.impl;

import com.numberone.common.support.Convert;
import com.numberone.system.domain.ActivityInfo;
import com.numberone.system.mapper.ActivityInfoMapper;
import com.numberone.system.service.IActivityInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 活动 服务层实现
 * 
 * @author numberone
 * @date 2020-09-28
 */
@Service
public class ActivityInfoServiceImpl implements IActivityInfoService
{
	@Autowired
	private ActivityInfoMapper activityInfoMapper;

	/**
     * 查询活动信息
     * 
     * @param id 活动ID
     * @return 活动信息
     */
    @Override
	public ActivityInfo selectActivityInfoById(Long id)
	{
	    return activityInfoMapper.selectActivityInfoById(id);
	}
	
	/**
     * 查询活动列表
     * 
     * @param activityInfo 活动信息
     * @return 活动集合
     */
	@Override
	public List<ActivityInfo> selectActivityInfoList(ActivityInfo activityInfo)
	{
	    return activityInfoMapper.selectActivityInfoList(activityInfo);
	}
	
    /**
     * 新增活动
     * 
     * @param activityInfo 活动信息
     * @return 结果
     */
	@Override
	public int insertActivityInfo(ActivityInfo activityInfo)
	{
	    return activityInfoMapper.insertActivityInfo(activityInfo);
	}
	
	/**
     * 修改活动
     * 
     * @param activityInfo 活动信息
     * @return 结果
     */
	@Override
	public int updateActivityInfo(ActivityInfo activityInfo)
	{
	    return activityInfoMapper.updateActivityInfo(activityInfo);
	}

	/**
     * 删除活动对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteActivityInfoByIds(String ids)
	{
		return activityInfoMapper.deleteActivityInfoByIds(Convert.toStrArray(ids));
	}

	/**
	 * 获取活动商品列表
	 * @param activityId
	 * @return
	 */
	@Override
	public List<ActivityInfo> selectActivityInfoGoods(Long activityId) {
		return activityInfoMapper.selectActivityInfoGoods(activityId);
	}


}
